<?php
$sections = array(
	array("alias" => "home"),
	array("alias" => "tours", "subsections" => array("last-100", "ocebreiro", "tui", "your-own-tour")),
	//array("alias" => "esencias", "subsections" => array("ruta1", "ruta2")),
	array("alias" => "semana-santa-2012"),
	array("alias" => "verano-2012"),
	array("alias" => "reservations"),
	array("alias" => "faq"),
	array("alias" => "info", "subsections" => array("packing", "weather", "training", "tips", "fun-facts", "travelling")),
	array("alias" => "blog"),
	array("alias" => "gallery"),
	array("alias" => "news"),
	array("alias" => "contact"),
	array("alias" => "legalnotice"),
	array("alias" => "links"),
	array("alias" => "sitemap"),
);

$code = "<ul class=\"sitemap-list-level1\">\n";
foreach ($sections as $sectionData) {
	$sectionAlias = $sectionData["alias"];
	$sectionName = $content->langmsg[$sectionAlias];
	$sectionUrl = Utils::generateSEOUrl($lang, $sectionAlias);
	$code .= "<li><a href=\"".$sectionUrl."\">".$sectionName."</a>";

	if (isset($sectionData["subsections"])) {
		$code .= "\n<ul class=\"sitemap-list-level2\">\n";
		foreach ($sectionData["subsections"] as $subsectionAlias) {
			$subsectionName = $content->langmsg[$subsectionAlias];
			$subsectionUrl = Utils::generateSEOUrl($lang, $sectionAlias, $subsectionAlias);
			$code .= "<li><a href=\"".$subsectionUrl."\">".$subsectionName."</a></li>\n";
		}
		$code .= "</ul>\n";
	}

	$code .= "</li>\n";
}
$code .= "</ul>\n";

$content->assign("content", $code);
?>
